//调用next()继续往下执行
module.exports = function (req, res, next) {
    if (req.pathname != '/' &&
        !req.pathname.startsWith('/home/login/') &&
        !req.pathname.startsWith('/api/') &&
        (req.ext == 'html' || req.ext == '') &&
        req.session.isNull()) {
        res.redirect('/');
    } else {
        if(req.pathname.toLowerCase() == "/js/lib/shared.js"){
            res.disableCache = true;
        }

        next();
    }
};